package edu.jimei.projecttachy.service;

import edu.jimei.projecttachy.entity.DataSource;
import edu.jimei.projecttachy.repository.DataSourceRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class DataSourceService {
    @Autowired
    private DataSourceRepository dataSourceRepository;

    public List<DataSource> findAll() { return dataSourceRepository.findAll(); }
    public DataSource save(DataSource ds) { return dataSourceRepository.save(ds); }
    public void delete(Long id) { dataSourceRepository.deleteById(id); }
    public Optional<DataSource> findById(Long id) { return dataSourceRepository.findById(id); }
} 